if (Meteor.isServer) { 
  //用户账号信息
  Meteor.publish('users', function () {
    if (!this.userId) {
      return;
    }
    return Meteor.users.find({'company_id':Meteor.users.findOne(this.userId).company_id},{fields:{services:0}});  //, { fields: { profile: 1 } }
  });

  //公司信息
  Meteor.publish('companies', function () {
    if(this.userId){
      return Companies.find({'_id':Meteor.users.findOne(this.userId).company_id});
    }
  });

  //部门
  Meteor.publish('departments', function () {
    if(this.userId){
      return Departments.find({'company_id':Meteor.users.findOne(this.userId).company_id});
    }
  });
  //商品分类
  Meteor.publish('product_catalogs', function () {
    if(this.userId){
      return ProductCatalogs.find({'company_id':Meteor.users.findOne(this.userId).company_id});
    }
  });

  // 供应商
  Meteor.publish('suppliers', function () {
    if(this.userId){
      return Suppliers.find({'company_id':Meteor.users.findOne(this.userId).company_id});
    }
  });
  Meteor.publish('purchase', function () {
    if(this.userId){
      return Purchase.find({'company_id':Meteor.users.findOne(this.userId).company_id});
    }
  });

}
